﻿@model List<CNav.Domain.Admin.FormConfiguration>

@{
    ViewBag.Title = "Form Configuration";
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <div>
        <table id="box-table-a">
            <tr>
                <th>Stage</th>
                <th>Form</th>
            </tr>
            @for (int i = 0; i < Model.Count(); i++)
            {
                <tr>
                    <td>@Html.DisplayFor(m => m[i].Stage) @Html.HiddenFor(m => m[i].ID)</td>
                    <td>@Html.DropDownListFor(m => m[i].FormID, new SelectList(ViewBag.FormList, "ID", "Name", Model[i].FormID))</td>
                </tr>
            }
        </table>
          @if (Model.Any())
          {
              <ol>
                  <li>
                      <label>&nbsp;</label>
                      <input type="submit" value="Save" />
                      <input type="button" value="Cancel" id="cancelButton" />
                  </li>

              </ol>
          }
    </div>
    
}

<script type="text/javascript">
    $(document).ready(function () {

        var cc = new CaseCentre();
        cc.BindCancel('#cancelButton', '@Url.Content("~/FormConfig/")');
    });
</script>
